import React, { Component } from 'react';
import {Fetch} from '../../fetch';

class Home extends Component {
  testFetch = async () => {
    let myHeaders = new Headers({
        // 'Access-Control-Allow-Origin': '*',
        'Content-Type': 'text/plain'
    });
    let options = {
      method: 'GET',
      headers: myHeaders,
      mode: 'cors'
    }
    try {
      const data = await Fetch('http://localhost:8000/api/category', options);
      console.log(data);
    } catch (error) {
      // console.log(error);
    }
  } 
  render() {
    this.testFetch();
    return (
      <div>home</div>
    )
  }
}

export default Home